<?php
function getOption($value_text,$selected='')
{
	$result='';
	foreach($value_text as $value=>$text)
	{
		$part_1 = '<option value="'.$value.'"';
		$part_selected = ' selected="selected"';
		$part_2 = '>'.$text."</option>\n";
		$result .= $part_1;
		if($value == $selected)
		{
			$result .= $part_selected;
		}
		$result .= $part_2;
	}
	return $result;
}

function getRadio($name,$value_text,$checked='',$disabled_array=array())
{
	$result='';
	foreach($value_text as $value=>$text)
	{
		$part_1 = '<label><input type="radio" name="'.$name.'" value="'.$value.'"';
		$part_checked = ' checked="checked"';
		$part_disbaled = ' disabled="disabled"';
		$part_2 = ' />'.$text."</label>\n";
		$result .= $part_1;
		if($value==$checked)
		{
			$result .= $part_checked;
		}
		if(in_array($value,$disabled_array))
		{
			$result .= $part_disbaled;
		}
		$result .= $part_2;
	}
	return $result;
}

function getCheckbox($name,$value_text)
{
	$result='';
	foreach($value_text as $value=>$text)
	{
		$result .= '<label><input type="checkbox" name="'.$name.'" value="'.$value.'" />'.$text."</label>\n";
	}
	return $result;
}

function getIeVersion($user_agent)
{
	$p = stripos($_SERVER['HTTP_USER_AGENT'],'MSIE');
	$ie_version = substr($_SERVER['HTTP_USER_AGENT'],$p+5,1);
	return $ie_version;
}

function checkUserAgent()
{
	
}

function checkFilmRating()
{
	
}

function checkUserCountry()
{
	
}
?>
